***********************************************************************
*																		*
*							Time										*
*																		*
**************************************************************************

* Author: Maria Preißinger, Alexander Wuttke



*---------------------------------------
* Interview date
*---------------------------------------

forvalues x=$all {
	gen 	date`x' = date(kp`x'_date_of_last, "YMD hms")
	format 	date`x' %td
}

	
*--------------------------------------------------------------
* Recode interviewdate into weeks before the election 2017
*--------------------------------------------------------------	

/* Only use the following
forvalues x=$all {
	gen welec`x' 	= wofd(td(24sep2017) - 	date`x')*(-1)
	lab var welec`x' "weeks before the election 2017 (in calendar weeks)"
}
*/

*--------------------------------------------------------------
* Recode interviewdate into weeks before provincial election
*--------------------------------------------------------------	


forvalues x=$all {
	gen welec`x' 	= wofd(td(15oct2017) - 	date`x')*(-1)
	lab var welec`x' "weeks before provincial election (in calendar weeks)"
}


